<%@taglib uri="/WEB-INF/struts-html.tld"  prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>

<html:form action="perpustakaan.do?action=peminjamanBukuSave">
    <table cellpadding="1" cellspacing="1" width="100%">
        <tr class="netral">
            <td colspan="2"><bean:message key="perpustakaan.peminjamanBuku"/></td>
        </tr>
        <tr>
            <td width="100%" colspan="2">
                <table cellpadding="1" cellspacing="1" width="100%">
                    <tr class="header">
                        <td><bean:message key="label.no"/></td>
                        <td><bean:message key="buku.kode"/></td>
                        <td><bean:message key="buku.nama"/></td>
                        <td><bean:message key="perpustakaan.tanggalPinjam"/></td>
                        <td><bean:message key="perpustakaan.tanggalKembali"/></td>
                    </tr>
                    <logic:empty name="listPeminjamanBuku">
                        <tr class="form">
                            <td colspan="5" align="center"><bean:message key="buku.buku"/> <bean:message key="label.isEmpty"/></td>
                        </tr>
                    </logic:empty>
                    <logic:notEmpty name="listPeminjamanBuku">
                        <c:forEach var="listPeminjamanBuku" items="${listPeminjamanBuku}" varStatus="row">
                            <c:if test="${(row.count) % 2 == 0}"><tr class="over"></c:if>
                            <c:if test="${(row.count) % 2 != 0}"><tr class="down"></c:if>
                                <td width="5%"><c:out value="${row.count}"/></td>
                                <td width="15%" align="left"><c:out value="${listPeminjamanBuku.buku.kodeBuku}"/></td>
                                <td width="35%" align="left"><c:out value="${listPeminjamanBuku.buku.namaBuku}"/></td>
                                <td width="15%" align="left"><f:formatDate value="${listPeminjamanBuku.tanggalPinjam}" pattern="dd-MMM-yyyy"/></td>
                                <td width="15%" align="left"><f:formatDate value="${listPeminjamanBuku.tanggalKembali}" pattern="dd-MMM-yyyy"/></td>
                            </tr>
                        </c:forEach>
                    </logic:notEmpty>
                    <tr class="form">
                        <td colspan="5" align="right"><html:link href="perpustakaan.do?action=bukuAdd" styleClass="noLink"><input type="button" value="${buttonAdd}"/></html:link>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr class="netral">
            <td colspan="2"><bean:message key="account.kartu"/></td>
        </tr>
        <tr class="form">
            <td><bean:message key="perpustakaan.kartuPerpus"/></td>
            <td>: <html:text property="kartuPerpus" onkeyup="cekKartuPerpus(this.value)" size="100"/><span id="theMessage"/></td>
        </tr>
        <tr class="form">
            <td colspan="2" align="right"><input type="button" onclick="validate_form()" value="${buttonAdd}"/></td>
        </tr>
    </table>
</html:form>